package com.ktg.mes.wm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ktg.mes.wm.domain.WmMaterialStock;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 库存记录Mapper接口
 *
 * @author yinjinlu
 * @date 2022-05-24
 */
public interface WmMaterialStockMapper  extends BaseMapper<WmMaterialStock>
{
    /**
     * 查询库存记录
     *
     * @param materialStockId 库存记录主键
     * @return 库存记录
     */
    public WmMaterialStock selectWmMaterialStockByMaterialStockId(Long materialStockId);

    /**
     * 查询库存记录
     *
     * @param wmMaterialStock 查询库存记录
     * @param page
     * @return 结果
     */
    public List selectWmMaterialStockList(WmMaterialStock wmMaterialStock);


    /**
     * 新增库存记录
     *
     * @param wmMaterialStock 库存记录
     * @return 结果
     */
    public int insertWmMaterialStock(WmMaterialStock wmMaterialStock);

    /**
     * 修改库存记录
     *
     * @param wmMaterialStock 库存记录
     * @return 结果
     */
    public int updateWmMaterialStock(WmMaterialStock wmMaterialStock);

    /**
     * 删除库存记录
     *
     * @param materialStockId 库存记录主键
     * @return 结果
     */
    public int deleteWmMaterialStockByMaterialStockId(Long materialStockId);

    /**
     * 批量删除库存记录
     *
     * @param materialStockIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteWmMaterialStockByMaterialStockIds(Long[] materialStockIds);


    /**
     * 更新产品ID
     *
     */
    public void updateProductItemId();

    /**
     * 更新仓库ID
     *
     */
    public void updateWareHouseId();

    /**
     * 删除库存
     */
    public void deleteMaterialStock();

    /**
     * 修改批次号的库存信息
     * @param item
     */
    public void updateStockQuantity(WmMaterialStock item);

    public IPage<Map> selectStockList(Page page,@Param("stock") WmMaterialStock stock);

}
